<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<%@ taglib uri="/WEB-INF/tld/sys.tld" prefix="sys" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>贷款信息</title>
    <jsp:include page="../../import.jsp" flush="true"/>
    <!-- 是否显示提交按钮 -->
    <sys:funcAuth resCd="LinkSubmit">
        <span id="isShowCmtBtn"/>
    </sys:funcAuth>
    <!-- 是否显示审核按钮 -->
    <sys:funcAuth resCd="LinkCheck">
        <span id="isShowAudBtn"/>
    </sys:funcAuth>
    <sys:funcAuth resCd="LinkCrAmt">
        <span id="isShowLinkCrAmtBtn"/>
    </sys:funcAuth>
    <!--是否显示变更按钮-->
    <sys:funcAuth resCd="LnkModify">
        <span id="isShowLnkModifyBtn" />
    </sys:funcAuth>
    <sys:funcAuth resCd="blacklist">
        <span id="blackList" />
    </sys:funcAuth>
</head>
<script type="text/javascript">
	var grid = null;
	var _mfrId;
	var pageInApp={}; // to 下一级子窗口 接口
    var pageInTab=null;
	$(function () {
		_groupId = '${groupId}';
		var _url =  '<%=path%>/grpcfg/splgrpprjbizview/initAsSureLoanList.do?groupId='+_groupId+'&cstRlCd=2' ;
	    $("#ligergrid1").ligerGrid({
	    	url: _url,
	    	method : 'get',
	        columns: [
				{ display: '担保人', name: 'cstNm', align:'center', width: 100,
                    totalSummary: {
                        type: 'sum',
                        render : function(suminf, column, cell){
                            return '总计';
                        }
                    }
				},
	            { display: '承租人', name: 'dataNm', align:'center', width: 100 },
                { display: '身份证号', name:'certNo', align:'center', width: 140},
				{ display: '支付表号', name: 'paySchNo', align:'center', width: 160 },
				{ display: '项目类型', name: 'prjTypCdNm', align:'center', width: 100 },
                { display: '期数', name: 'lsPd', align:'center', width: 80 },
                { display: '起租日', name: 'lsDt', align:'center', width: 100 ,render:renderDate},
                { display: '融资金额', name: 'actLsAmt', align:'center',width: 100,
                    render: function (rowdata, index, value) {
                        return '¥'+FormatMoney(rowdata.actLsAmt / 100);
                    },
                    totalSummary: {
                        type: 'sum',
                        render : function(suminf, column, cell){
                            return '¥'+FormatMoney(suminf.sum / 100);
                        }
                    }
                },
                { display: '剩余敞口', name: 'repayExpoAmt', align:'center',width: 100,
                    render: function (rowdata, index, value) {
                        return '¥'+FormatMoney(rowdata.repayExpoAmt / 100);
                    },
                    totalSummary: {
                        type: 'sum',
                        render : function(suminf, column, cell){
                            return '¥'+FormatMoney(suminf.sum / 100);
                        }
                    }
                },
                { display: '30+敞口', name: 'repayBkExpoAmt', align:'center',width: 100,
                    render: function (rowdata, index, value) {
                        return '¥'+FormatMoney(rowdata.repayBkExpoAmt / 100);
                    },
                    totalSummary: {
                        type: 'sum',
                        render : function(suminf, column, cell){
                            return '¥'+FormatMoney(suminf.sum / 100);
                        }
                    }
                },
                { display: '实际逾期天数', name: 'overdueDay', align:'center', width: 100 },
                { display: '最大逾期天数', name: 'maxOvdDay', align:'center', width: 100 },
            ],
            pageSize:10,
            root:'rows',
            record:'total',
            hideLoadButton : true,
            width: '100%',
            height:'100%',
            heightDiff:-2,
            checkbox:true,
            fixedCellHeight: false,
            rownumbers:true,
//			onAfterShowData: getFlowIds,
	    });
	    grid = liger.get("ligergrid1");
	    grid.setHeight(100);
	    $("#searchBar").ligerForm();
	    $('#reasonFromSet').ligerForm({
	        validate : true
		});
        $("#searchBtn").click(function(event) {
            var form = new liger.get("searchBar");
            var data = form.getData();
            console.log(JSON.stringify(data));
            for (name in data){
                grid.setParm(name,data[name]);
            };
            grid.reload();
        });
        /* 清空 */
        $("#clearBtn").click(function(event) {
            $("#resetBtn").click();  //重置 input-text
            var form = liger.get("searchBar");
            form.setData({  //重置select等特殊表单
                "dataId":"",
                "dataNm":"",
                "cstNm":""
            });
        });
	});
    //格式化时间
    function renderDate(rowdata, index, value) {
        var dateStr = "";
        if (null != value) {
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
        }
        return dateStr;
    }

</script>
<body class="iframeBody">
<div class="Wrapper">
	<div class="sqPanel_body">
		<div class="searchArea">
		    <form id="searchBar">
		        <div class="fieldset1 clearFix">
		            <div class="fieldBox">
		                <div class="label">成员ID</div>
		                <div class="field">
		                    <input name="dataId" id="dataId" type="text" class="ui-textbox" value="">
		                </div>
		            </div>
		            <div class="fieldBox">
		                <div class="label">成员名称</div>
		                <div class="field">
		                    <input name="dataNm" id="dataNm" type="text" class="ui-textbox" value="">
		                </div>
		            </div>
		            <div class="fieldBox">
		                <div class="label">承租人</div>
		                <div class="field">
		                    <input name="cstNm" id="cstNm" type="text" class="ui-textbox" value="">
		                </div>
		            </div>
		            <div class="clearFix"></div>
					<div class="formBtns notRight">
						<span id="searchBtn" class="sq-button sq-button-round">查询</span>
						<span id="clearBtn" class="sq-button sq-button-round">清空</span>
						<input id="resetBtn" type="reset" value="重置" class="l-button l-button-reset Hide"/>
		            </div>
		         </div>
		    </form>
    </div>
			<div id="ligergrid1" class="sq-grid"></div>
		</div>
</div>

</body>
</html>